import ajax from '@/ajax/News'

const state = {
    news: []
}

const getters = {
    news: state => state.news
}

const mutations = {
     setNews (state,news) {
         state.news = news
     }
}

const actions = {
    getNews ({commit},payload) {
        ajax.getNews(news => {
            commit('setNews',news)
        },playload)
    }
}


export default {
    state,
    getters,
    mutations,
    actions
}